﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using UserLoging.Models;

namespace UserLoging.Database
{
    public class UserDbContext:DbContext
    {
        public UserDbContext(DbContextOptions<UserDbContext> options) : base(options) { }
        public DbSet<User> User { get; set; }
        protected override void OnModelCreating(ModelBuilder modelBuilder) 
        {
            modelBuilder.Entity<User>().HasData(new User()
            {
                UserId = Guid.NewGuid(),
                UserName="admin",
                password="123456",
                CreateTime=DateTime.UtcNow,
                Permission= Permission.admin,
                number="18031231211",
            });
        }
    }
}
